<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/themes/admin/assets/css/layui.css">
</head>
<body>
<form class="layui-form" action="">
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">自定义代码</label>
        <div class="layui-input-block">
            <textarea style="height: 300px;color: #319ABD" name="statistics" placeholder="百度统计代码或者百度推送链接代码"  class="layui-textarea">{$statistics}</textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="statistics">保存</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script src="/themes/admin/assets/layui.js"></script>
<script src="/themes/admin/assets/jquery-3.2.1.min.js"></script>
<script>
    layui.use("layer");
    layui.use('form', function(){
        var form = layui.form;
        form.on('submit(statistics)', function(data){
            $.ajax({
                type:"post",
                data:"statistics=" + data.field.statistics,
                url:"/admin/system/statistics",
                success:function (e) {
                    layer.msg(e.msg);
                }
            });
            return false;
        });
    });
</script>
</body>
</html>